import React, { Component } from 'react';
import {Switch,Route} from 'react-router-dom';
import App from './App';
import Login from './../view/login';
import { createStore } from 'redux';
import { BrowserRouter } from 'react-router-dom';
import { hot } from 'react-hot-loader';
import { Provider } from 'react-redux';
import reducers from './../reducers';


const store = createStore(reducers);

class Root extends Component {
    render() {
        return (
            <Provider store={store}>
            <BrowserRouter>
                <Switch>
                    <Route path='/login' component={Login}></Route>
                    <Route path='/' component={App}></Route>
                   

                </Switch>
                </BrowserRouter>
         </Provider> 
        );
    }
}

export default hot(module)(Root);
